<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<!-- 这里的navigator 路由导航  -->
		<!-- 属性 open-type 打开导航的方式 注意 跳转到tabBar页面 要设置open-type="switchTab" -->
		<navigator url="/pages/user/user" open-type="switchTab">用户中心</navigator>
		<navigator url="/pages/cart/cart" open-type="switchTab">购物车</navigator>
		<button @click="showMe">提示</button>
		<navigator url="/pages/location/location">联系我们</navigator>
		<view>
			pinia数据:{{username}} <button type="default" @click="changeusername">修改名字</button>
		</view>
	</view>
</template>

<script>
	import loginStore from '../../loginStore.js'
	export default {
		data() {
			return {
				title: '000000009999999999'
			}
		},
		onLoad() {

		},
		computed:{
			username(){
				return loginStore().username;
			}
		},
		methods: {
			changeusername(){
				loginStore().changename("王五")
			},
			showMe(){
				uni.showToast({
					title:"提示信息"
				});
				uni.showLoading({
					title:"努力加载种...."
				});
				setTimeout(()=>{
					uni.hideLoading()
				},2000)
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
